using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class ResetUIController : MonoBehaviour
{

    [SerializeField] TMP_Text resetText;
    [SerializeField] float textExtandSpeed = 20f;

    float m_orgSpacing;

    bool m_isReseting;

    // Start is called before the first frame update
    void Start()
    {
        gameObject.SetActive(false);
        m_isReseting = false;
        m_orgSpacing = resetText.characterSpacing;
    }

    // Update is called once per frame
    void Update()
    {
        if (m_isReseting)
        {
            resetText.characterSpacing += textExtandSpeed * Time.deltaTime;
        }
    }

    public void OnResetStart()
    {
        gameObject.SetActive(true);
        m_isReseting = true;
    }

    public void OnResetDone()
    {
        gameObject.SetActive(false);
        m_isReseting = false;
        resetText.characterSpacing = m_orgSpacing;
}
}
